package com.lanyam.travel.base.service.impl;


import com.lanyam.travel.base.entity.TravelStore;
import com.lanyam.travel.base.entity.vo.TravelStoreVo;
import com.lanyam.travel.base.dao.TravelStoreMapper;
import com.lanyam.travel.base.service.ITravelStoreService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
import java.util.Map;
import javax.annotation.Resource;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;


@Service
@Transactional
@Slf4j
public class TravelStoreServiceImpl implements ITravelStoreService {

    @Resource
    private TravelStoreMapper travelStoreMapper;

    @Override
    public IPage<TravelStoreVo> getPageTravelStore (Map<String, Object> queryMap, Integer page, Integer rows) {
        Page<TravelStoreVo> pageSize = new Page<TravelStoreVo>(page, rows);
        Page<TravelStoreVo> pageInfo = travelStoreMapper.getPage(pageSize, queryMap);
        return pageInfo;
    }

    @Override
    public void addTravelStore(TravelStore travelStore) {
        travelStoreMapper.insert(travelStore);
    }

    @Override
    public void updateTravelStore(TravelStore travelStore) {
        travelStoreMapper.updateById(travelStore);
    }

    @Override
    public void delById(String id) {
        travelStoreMapper.delById(id);
    }
}